<?php

class WebUser extends CWebUser
{
    private $_model = null;

    public function getRole()
    {	
	$model = $this->getModel();	
	if ($model) {	    
	    return Yii::app()->params['roles'][$model->role_id];
	}
	return false;	    
    }

    public function getModel()
    {
	if (!$this->isGuest && $this->_model === null) {
	    $this->_model = FactoryService::get('user')->get($this->getId());
	}
	return $this->_model;
    }

}

?>
